<?php

/*
 * @author Ebrain Cedeno <ebraincedeno@gmail.com>
 */


class RolController extends Controller{
    
    public function actionNew(){
        
        $rol = new rol();
        if (isset($_POST['guardar'])){
            $rol->setAttributes($_POST);
            if ($rol->validate()){
                if ($rol->save()){
                    $this->redirec(VeCms::createUrl("./grid"));
                }
            }
        }
        
        
        $this->form = new TForm();
        $this->form->Method = "POST";
        $this->form->Action = VeCms::createUrl("./new");
        
        $this->description_label = new TLabel("Descripcion:");
        $this->description_label->OptionsAditional = array('style'=>array('font-weight:bold'));
        
        $this->description_text = new TTextView();
        $this->description_text->Name = "description";
        $this->description_text->Id = $this->description_text->Name;
        $this->description_text->Cols = "10";
        $this->description_text->Rows = "10";
        $this->description_text->Width = 250;
        $this->description_text->Height = 100;
        $this->description_text->Text = $rol->description;
        $this->description_text->OptionsAditional['style'] = array('border:1px solid black');
        
        $this->admin_label = new TLabel("Es Administrador?");
        $this->admin_label->OptionsAditional = array('style'=>array('font-weight:bold'));
        
        $this->admin_checkbox = new TCheckBox();
        $this->admin_checkbox->Name = "admin";
        $this->admin_checkbox->Checked = false; 
        
        $this->button_cancel = new TButton("Cancelar");
        $this->button_cancel->Type = "reset";
        $this->button_cancel->OptionsAditional = array('style'=>array('font-weight:bold','cursor:pointer'));
        
        $this->button_guardar = new TButton("Guardar");
        $this->button_guardar->Name = "guardar";
        $this->button_guardar->OptionsAditional = array('style'=>array('font-weight:bold','cursor:pointer'));
        
        
        
        
        
        
    }
    
    public function actionGrid(){
        
    }
    
}

?>
